

/*	Motor Functions

	Author: Jared Bayne (JaredNBayne@gmail.com)
	Created: March 24th, 2007


	Direction 1= Forward
	Direction 2= Backward
	Speed 0= Stop
	Speed 255= Full
	
*/

#ifndef _MOTORS_H
#define _MOTORS_H


//Defines for Motor Control Pins
#define		M1C1				GET_BIT(PORTB).bit4
#define		M1C2				OCR1B


#define		M2C1				GET_BIT(PORTB).bit2
#define		M2C2				OCR1A





#define		Forward			2	
#define		Backward		1

void go(int m1dir, int m1spd, int m2dir, int m2spd);	
void motors_init(void);
void stop(void); //stop function
void goforward(int speed); //forward motion function
void goforward_perfectlystraight(int distance, int speed);	//go forward with no curve at all
void goleft(int speed); //Tank turn left function
void goleft_perfect(int distance, int speed); 
void goright_perfect(int distance, int speed); 
void goright(int speed); //Tank turn right function
void gobackward(int speed); //backward motion function
void gobackward_perfectlystraight(int distance, int speed);	//go forward with no curve at all

#include "Motors.c"

#endif
